﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
//using System.Xml.Linq;
using YouHP.Utility;
using YouHP.BLL;

namespace web.admin
{
    public partial class DistrictDel : System.Web.UI.Page
    {
        public string nextUrl;
        protected void Page_Load(object sender, EventArgs e)
        {
            int id = RequestTools.GetQueryInt("id", -1);
            int pid = RequestTools.GetQueryInt("parentId", -1);
            if (pid == 0)
            {
                nextUrl = "ProvinceList.aspx";
            }
            else
            {
                nextUrl = "CityList.aspx?parentId=" + pid;
            }
            try
            {
                if (id >= 0)
                {
                    int[] idlist = new int[1];
                    idlist[0] = id;

                    if (DistrictBLL.Instance.DelDistrict(idlist))
                    {
                      
                        HttpContext.Current.Response.Redirect(nextUrl, true);
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

        }
    }
}
